//
//  Statues.swift
//  weibo
//
//  Created by 叶子韬韬 on 2017/5/2.
//  Copyright © 2017年 叶子韬韬. All rights reserved.
//

import UIKit

class Statues : NSObject{

    // MARK:- #注释>微博创建时间
    var created_at:String?
    
    var source:String?  //微博来源
   
    var text:String?  //微博的正文
    
    var id:Int = 0   //微博的id
    
    var user: User?    //微博的用户
    var pic_urls :[[String:String]]?   //微博的配图
    
    var retweeted_status : Statues?  //微博对应的转发的微博
    
    
    init(dict:[String:Any]) {
        super.init()
        
        setValuesForKeys(dict)
        
        
        //从字典把user取出来
        if let userDict = dict["user"] as? [String:Any] {
            user = User(dict: userDict)
        }
        
        //将转发微博的字段转成微博对象
        if let retweetedDict = dict["retweeted_status"] as? [String:Any] {
            retweeted_status = Statues(dict: retweetedDict)
        }
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
    }
    
}
